import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)
const Visitor = () => import('../views/Visitor.vue')
const admin = () =>import('../views/admin.vue')
const list = () => import('../views/list.vue')
const homepage = () => import('../views/homepage.vue')
const file = () => import('../views/file.vue')
const cancel = () => import('../views/cancel.vue')
const school = () => import('../views/school.vue')
const guanli = () => import('../views/guanli.vue')
const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect:'/homepage',
    children:[
      {
        path: '/homepage',
        name: 'homepage',
        component: homepage
      },
      {
        path: '/admin',
        name: 'admin',
        component: admin
      },
      {
        path: '/list',
        name: 'list',
        component: list
      },,
      {
        path: '/guanli',
        name: 'guanli',
        component: guanli
      },
      {
        path: '/cancel',
        name: 'cancel',
        component: cancel
      },
      {
        path: '/file',
        name: 'file',
        component: file
      },{
         path: '/school',
        name: 'school',
        component: school
      },{
        path: '/Visitor',
        name: 'Visitor',
        component:Visitor
      }
    ]
  },
  {
    path: '/about',
    name: 'About',
    component: () => import( '../views/About.vue')
  }
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router

